From: Juergen Gross Date: Wed, 23 Aug 2017 17:34:00 +0000 (+0200) Subject: xen/arch/x86/nmi.c: let custom parameter parsing routines return errno X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1590 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=dee826c8a3932fab17f1aee34525e8b301b88b00;p=xen.git xen/arch/x86/nmi.c: let custom parameter parsing routines return errno Modify the custom parameter parsing routines in: xen/arch/x86/nmi.c to indicate whether the parameter value was parsed successfully. Signed-off-by: Juergen Gross Acked-by: Wei Liu Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index e44f88045e..d7fce28805 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -46,35 +46,44 @@ bool __initdata opt_watchdog; /* watchdog_force: If true, process unknown NMIs when running the watchdog. */ bool watchdog_force; -static void __init parse_watchdog(char *s) +static int __init parse_watchdog(const char *s) { if ( !*s ) { opt_watchdog = true; - return; + return 0; } switch ( parse_bool(s, NULL) ) { case 0: opt_watchdog = false; - return; + return 0; case 1: opt_watchdog = true; - return; + return 0; } if ( !strcmp(s, "force") ) watchdog_force = opt_watchdog = true; + else + return -EINVAL; + + return 0; } custom_param("watchdog", parse_watchdog); /* opt_watchdog_timeout: Number of seconds to wait before panic. */ static unsigned int opt_watchdog_timeout = 5; -static void parse_watchdog_timeout(char * s) + +static int parse_watchdog_timeout(const char *s) { - opt_watchdog_timeout = simple_strtoull(s, NULL, 0); + const char *q; + + opt_watchdog_timeout = simple_strtoull(s, &q, 0); opt_watchdog = !!opt_watchdog_timeout; + + return *q ? -EINVAL : 0; } custom_param("watchdog_timeout", parse_watchdog_timeout);